﻿<script src="assets/js/controller/calendarController.js"></script>
<div ng-controller="holidayInfoController">
    <ol class="breadcrumb pull-right">
        <li><a ui-sref="app.home">汇票线</a></li>
        <li><a ui-sref="app.constants">常量管理</a></li>
        <li class="active">节假日管理</li>
    </ol>

    <h1 class="page-header"><i class="fa fa-lg text-success fa-fax"></i>节假日管理</h1>

    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-inverse">
                <div class="panel-heading">
                    <div class="panel-heading-btn">
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-repeat"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-danger" data-click="panel-remove"><i class="fa fa-times"></i></a>
                    </div>
                    <h4 class="panel-title">节假日管理</h4>
                </div>
                <div class="panel-body">
                    <div class="form-inline filter-option">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="pull-right">
                                    <input type="text" ng-model="filter.keyword" class="form-control input-sm" placeholder="关键词" />
                                    <button class="btn btn-sm btn-info" ng-click="reflash()"><i class="fa fa-search"></i> 筛选</button>
                                    <button class="btn btn-sm btn-success" ng-click="edit()"><i class="fa fa-plus-circle"></i> 新增</button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="pull-left">
                        <div id="date">
                            <p>
                                公历
                                <select onchange="changeCld()" id="sy">
                                    <option>1900</option>
                                    <option>1901</option>
                                    <option>1902</option>
                                    <option>1903</option>
                                    <option>1904</option>
                                    <option>1905</option>
                                    <option>1906</option>
                                    <option>1907</option>
                                    <option>1908</option>
                                    <option>1909</option>
                                    <option>1910</option>
                                    <option>1911</option>
                                    <option>1912</option>
                                    <option>1913</option>
                                    <option>1914</option>
                                    <option>1915</option>
                                    <option>1916</option>
                                    <option>1917</option>
                                    <option>1918</option>
                                    <option>1919</option>
                                    <option>1920</option>
                                    <option>1921</option>
                                    <option>1922</option>
                                    <option>1923</option>
                                    <option>1924</option>
                                    <option>1925</option>
                                    <option>1926</option>
                                    <option>1927</option>
                                    <option>1928</option>
                                    <option>1929</option>
                                    <option>1930</option>
                                    <option>1931</option>
                                    <option>1932</option>
                                    <option>1933</option>
                                    <option>1934</option>
                                    <option>1935</option>
                                    <option>1936</option>
                                    <option>1937</option>
                                    <option>1938</option>
                                    <option>1939</option>
                                    <option>1940</option>
                                    <option>1941</option>
                                    <option>1942</option>
                                    <option>1943</option>
                                    <option>1944</option>
                                    <option>1945</option>
                                    <option>1946</option>
                                    <option>1947</option>
                                    <option>1948</option>
                                    <option>1949</option>
                                    <option>1950</option>
                                    <option>1951</option>
                                    <option>1952</option>
                                    <option>1953</option>
                                    <option>1954</option>
                                    <option>1955</option>
                                    <option>1956</option>
                                    <option>1957</option>
                                    <option>1958</option>
                                    <option>1959</option>
                                    <option>1960</option>
                                    <option>1961</option>
                                    <option>1962</option>
                                    <option>1963</option>
                                    <option>1964</option>
                                    <option>1965</option>
                                    <option>1966</option>
                                    <option>1967</option>
                                    <option>1968</option>
                                    <option>1969</option>
                                    <option>1970</option>
                                    <option>1971</option>
                                    <option>1972</option>
                                    <option>1973</option>
                                    <option>1974</option>
                                    <option>1975</option>
                                    <option>1976</option>
                                    <option>1977</option>
                                    <option>1978</option>
                                    <option>1979</option>
                                    <option>1980</option>
                                    <option>1981</option>
                                    <option>1982</option>
                                    <option>1983</option>
                                    <option>1984</option>
                                    <option>1985</option>
                                    <option>1986</option>
                                    <option>1987</option>
                                    <option>1988</option>
                                    <option>1989</option>
                                    <option>1990</option>
                                    <option>1991</option>
                                    <option>1992</option>
                                    <option>1993</option>
                                    <option>1994</option>
                                    <option>1995</option>
                                    <option>1996</option>
                                    <option>1997</option>
                                    <option>1998</option>
                                    <option>1999</option>
                                    <option>2000</option>
                                    <option>2001</option>
                                    <option>2002</option>
                                    <option>2003</option>
                                    <option>2004</option>
                                    <option>2005</option>
                                    <option>2006</option>
                                    <option>2007</option>
                                    <option>2008</option>
                                    <option>2009</option>
                                    <option>2010</option>
                                    <option>2011</option>
                                    <option>2012</option>
                                    <option>2013</option>
                                    <option>2014</option>
                                    <option>2015</option>
                                    <option>2016</option>
                                    <option>2017</option>
                                    <option>2018</option>
                                    <option>2019</option>
                                    <option>2020</option>
                                    <option>2021</option>
                                    <option>2022</option>
                                    <option>2023</option>
                                    <option>2024</option>
                                    <option>2025</option>
                                    <option>2026</option>
                                    <option>2027</option>
                                    <option>2028</option>
                                    <option>2029</option>
                                    <option>2030</option>
                                    <option>2031</option>
                                    <option>2032</option>
                                    <option>2033</option>
                                    <option>2034</option>
                                    <option>2035</option>
                                    <option>2036</option>
                                    <option>2037</option>
                                    <option>2038</option>
                                    <option>2039</option>
                                    <option>2040</option>
                                    <option>2041</option>
                                    <option>2042</option>
                                    <option>2043</option>
                                    <option>2044</option>
                                    <option>2045</option>
                                    <option>2046</option>
                                    <option>2047</option>
                                    <option>2048</option>
                                    <option>2049</option>
                                </select>
                                年
                                <select onchange="changeCld()" id="sm">
                                    <option>1</option>
                                    <option>2</option>
                                    <option>3</option>
                                    <option>4</option>
                                    <option>5</option>
                                    <option>6</option>
                                    <option>7</option>
                                    <option>8</option>
                                    <option>9</option>
                                    <option>10</option>
                                    <option>11</option>
                                    <option>12</option>
                                </select>
                                月
                                <span id="gz">&nbsp;</span>
                            </p>
                        </div>
                        <div id="calendar">
                            <div id="detail"><div id="datedetail"></div><div id="festival"></div></div>
                            <table id="calendarhead">
                                <tr>
                                    <td>日</td>
                                    <td>一</td>
                                    <td>二</td>
                                    <td>三</td>
                                    <td>四</td>
                                    <td>五</td>
                                    <td>六</td>
                                </tr>
                            </table>
                            <table id="week">
                                <tr class="tr1">
                                    <td class="aorange" id="sd0"></td>
                                    <td class="one" id="sd1"></td>
                                    <td class="one" id="sd2"></td>
                                    <td class="one" id="sd3"></td>
                                    <td class="one" id="sd4"></td>
                                    <td class="one" id="sd5"></td>
                                    <td class="agreen" id="sd6"></td>
                                </tr>
                                <tr class="tr2">
                                    <td id="ld0"></td>
                                    <td id="ld1"></td>
                                    <td id="ld2"></td>
                                    <td id="ld3"></td>
                                    <td id="ld4"></td>
                                    <td id="ld5"></td>
                                    <td id="ld6"></td>
                                </tr>
                                <tr class="tr1">
                                    <td class="aorange" id="sd7"></td>
                                    <td class="one" id="sd8"></td>
                                    <td class="one" id="sd9"></td>
                                    <td class="one" id="sd10"></td>
                                    <td class="one" id="sd11"></td>
                                    <td class="one" id="sd12"></td>
                                    <td class="aorange" id="sd13"></td>
                                </tr>
                                <tr class="tr2">
                                    <td id="ld7"></td>
                                    <td id="ld8"></td>
                                    <td id="ld9"></td>
                                    <td id="ld10"></td>
                                    <td id="ld11"></td>
                                    <td id="ld12"></td>
                                    <td id="ld13"></td>
                                </tr>
                                <tr class="tr1">
                                    <td class="aorange" id="sd14"></td>
                                    <td class="one" id="sd15"></td>
                                    <td class="one" id="sd16"></td>
                                    <td class="one" id="sd17"></td>
                                    <td class="one" id="sd18"></td>
                                    <td class="one" id="sd19"></td>
                                    <td class="agreen" id="sd20"></td>
                                </tr>
                                <tr class="tr2">
                                    <td id="ld14"></td>
                                    <td id="ld15"></td>
                                    <td id="ld16"></td>
                                    <td id="ld17"></td>
                                    <td id="ld18"></td>
                                    <td id="ld19"></td>
                                    <td id="ld20"></td>
                                </tr>
                                <tr class="tr1">
                                    <td class="aorange" id="sd21"></td>
                                    <td class="one" id="sd22"></td>
                                    <td class="one" id="sd23"></td>
                                    <td class="one" id="sd24"></td>
                                    <td class="one" id="sd25"></td>
                                    <td class="one" id="sd26"></td>
                                    <td class="aorange" id="sd27"></td>
                                </tr>
                                <tr class="tr2">
                                    <td id="ld21"></td>
                                    <td id="ld22"></td>
                                    <td id="ld23"></td>
                                    <td id="ld24"></td>
                                    <td id="ld25"></td>
                                    <td id="ld26"></td>
                                    <td id="ld27"></td>
                                </tr>
                                <tr class="tr1">
                                    <td class="aorange" id="sd28"></td>
                                    <td class="one" id="sd29"></td>
                                    <td class="one" id="sd30"></td>
                                    <td class="one" id="sd31"></td>
                                    <td class="one" id="sd32"></td>
                                    <td class="one" id="sd33"></td>
                                    <td class="agreen" id="sd34"></td>
                                </tr>
                                <tr class="tr2">
                                    <td id="ld28"></td>
                                    <td id="ld29"></td>
                                    <td id="ld30"></td>
                                    <td id="ld31"></td>
                                    <td id="ld32"></td>
                                    <td id="ld33"></td>
                                    <td id="ld34"></td>
                                </tr>
                                <tr class="tr1">
                                    <td class="aorange" id="sd35"></td>
                                    <td class="one" id="sd36"></td>
                                    <td class="one" id="sd37"></td>
                                    <td class="one" id="sd38"></td>
                                    <td class="one" id="sd39"></td>
                                    <td class="one" id="sd40"></td>
                                    <td class="aorange" id="sd41"></td>
                                </tr>
                                <tr class="tr2">
                                    <td id="ld35"></td>
                                    <td id="ld36"></td>
                                    <td id="ld37"></td>
                                    <td id="ld38"></td>
                                    <td id="ld39"></td>
                                    <td id="ld40"></td>
                                    <td id="ld41"></td>
                                </tr>
                            </table>
                        </div>
                        <div id="panel">
                            <div onclick="pushBtm('YU')">上一年↑</div>
                            <div onclick="pushBtm('YD')">下一年↓</div>
                            <div onclick="pushBtm('MU')">上一月↑</div>
                            <div onclick="pushBtm('MD')">下一月↓</div>
                            <div onclick="pushBtm('')">当前月</div>
                        </div>
                        <img hidden src="about:blank" onerror="javascript: initial()" />
                    </div>
                    <div class="pull-left">
                        <table id="data-table" ng-table="tableParams" template-pagination="template/pagination.html" class="table table-striped table-bordered table-hover table-condensed">
                            <tr ng-repeat="item in $data">
                                <td data-title="'序号'" width="10%" class="text-center">{{ first + $index }}</td>
                                <td data-title="'假日类型'" sortable="'day_type'" class="text-center">{{ item.day_type }}</td>
                                <td data-title="'假期开始时间'" class="text-center">{{ item.holiday_start_time }}</td>
                                <td data-title="'假期结束时间'" sortable="'holiday_end_time'" class="text-center">{{ item.holiday_end_time | date: 'yyyy-MM-dd' }}</td>
                                <td data-title="'描述'" sortable="'description'" class="text-center">{{ item.description }}</td>
                                <td class="text-center width-100 text-nowrap">
                                    <button class="btn btn-success btn-xs" ng-click="edit(item)"><i class="fa fa-edit"></i> 编辑</button>
                                    <button class="btn btn-success btn-xs" ng-click="remove(item)"><i class="fa fa-trash-o"></i> 删除</button>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <!-- #modal-dialog -->
                    <div class="modal fade" id="modal-edit">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <ng-form name="editForm" novalidate>
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                        <h4 class="modal-title"><i class="fa fa-lg fa-edit text-success"></i> 假期信息</h4>
                                    </div>
                                    <div class="modal-body">
                                        <div class="form-horizontal form-inline">
                                            <div class="form-group" ng-class="{ 'has-error': editForm.holiday_start_time.$invalid && !editForm.holiday_start_time.$pristine }">
                                                <label class="col-md-5 control-label"><font color="red">*</font> 假期开始时间：</label>
                                                <div class="col-md-7">
                                                    <input type="text" name="holiday_start_time" ng-model="model.holiday_start_time" class="form-control" required />
                                                </div>
                                            </div>
                                            <div class="form-group" ng-class="{ 'has-error': editForm.holiday_end_time.$invalid && editForm.holiday_end_time.$dirty }">
                                                <label class="col-md-5 control-label"><font color="red">*</font> 假期结束时间：</label>
                                                <div class="col-md-7">
                                                    <input type="text" name="holiday_end_time" ng-model="model.holiday_end_time" class="form-control" required />
                                                </div>
                                            </div>
                                            <div class="form-group" ng-class="{ 'has-error': editForm.day_type.$invalid && editForm.day_type.$dirty }">
                                                <label class="col-md-5 control-label"><font color="red">*</font> 假日类型：</label>
                                                <div class="col-md-7">
                                                    <input type="text" name="day_type" ng-model="model.day_type" class="form-control" required />
                                                    <!--<select name="day_type" ng-model="model.holiday_or_workday" ng-options="item.day_type for item in holidays" class="form-control" required></select>-->
                                                </div>
                                            </div>
                                            <div class="form-group" ng-class="{ 'has-error': editForm.description.$invalid && editForm.description.$dirty }">
                                                <label class="col-md-5 control-label"><font color="red">*</font> 描述：</label>
                                                <div class="col-md-7">
                                                    <input type="text" name="description" ng-model="model.description" class="form-control" required />
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="submit" class="btn btn-sm btn-success" ng-click="save()" ng-disabled="editForm.$invalid"><i class="fa fa-save"></i> 保存</button>
                                        <button type="button" class="btn btn-sm btn-white" data-dismiss="modal"><i class="fa fa-share-square-o"></i> 关闭</button>
                                    </div>
                                </ng-form>
                            </div>
                        </div>
                    </div>  
                </div>
            </div>
        </div>
    </div>
</div>
